'use strict';
angular.module('clientApp')
.directive('consultervol', function(/*flightAPI, ngToast*/) {
    return {
        restrict : 'E',
        scope : {
            volSelected : '='
        },
        link : function($scope) {
        	$scope.$watch('volSelected', function() {
        		if ($scope.volSelected) {
        			$scope.departureTimeText = new Date($scope.volSelected.departureTime).toLocaleString();
                	$scope.arrivalTimeText = new Date($scope.volSelected.arrivalTime).toLocaleString();
        		}
        	});
        },
        templateUrl : 'views/directiveConsulterVol.html',
        replace : true
    };
});
